package com.haoniu.module.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.haoniu.module.mapper.UserMoneyDetailMapper;
import com.haoniu.module.domain.database.UserMoneyDetail;
import com.haoniu.module.service.UserMoneyDetailService;
import com.haoniu.common.support.Convert;

/**
 * 金额详情流水 服务层实现
 * 
 * @author houyijun
 * @date 2019-01-25
 */
@Service
public class UserMoneyDetailServiceImpl implements UserMoneyDetailService
{
	@Autowired
	private UserMoneyDetailMapper userMoneyDetailMapper;

	/**
     * 查询金额详情流水信息
     * 
     * @param id 金额详情流水ID
     * @return 金额详情流水信息
     */
    @Override
	public UserMoneyDetail selectUserMoneyDetailById(Integer id) {
	    return userMoneyDetailMapper.selectUserMoneyDetailById(id);
	}
	
	/**
     * 查询金额详情流水列表
     * 
     * @param userMoneyDetail 金额详情流水信息
     * @return 金额详情流水集合
     */
	@Override
	public List<UserMoneyDetail> selectUserMoneyDetailList(UserMoneyDetail userMoneyDetail) {
	    return userMoneyDetailMapper.selectUserMoneyDetailList(userMoneyDetail);
	}
	
    /**
     * 新增金额详情流水
     * 
     * @param userMoneyDetail 金额详情流水信息
     * @return 结果
     */
	@Override
	public int insertUserMoneyDetail(UserMoneyDetail userMoneyDetail) {
	    return userMoneyDetailMapper.insertUserMoneyDetail(userMoneyDetail);
	}
	
	/**
     * 修改金额详情流水
     * 
     * @param userMoneyDetail 金额详情流水信息
     * @return 结果
     */
	@Override
	public int updateUserMoneyDetail(UserMoneyDetail userMoneyDetail) {
	    return userMoneyDetailMapper.updateUserMoneyDetail(userMoneyDetail);
	}

	/**
     * 删除金额详情流水对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteUserMoneyDetailByIds(String ids) {
		return userMoneyDetailMapper.deleteUserMoneyDetailByIds(Convert.toStrArray(ids));
	}

	/**
	 * 用户金额流水
	 * @param userId
	 * @return
	 */
	@Override
	public List<UserMoneyDetail> selectUserMoneyDetailByUserId(Integer userId) {
		return userMoneyDetailMapper.selectUserMoneyDetailByUserId(userId);
	}

}
